import React, { Component } from 'react';
import HelloWorld from './HelloWorld'
import './App.css';

export default class App extends Component<{}, {parentData: any}> {

  constructor(props:{}) {
    super(props);
    this.state = {
      parentData: {
        msg:'kongmsg',
        time: 'kongtime'
      }
    };
  }

  componentDidMount() {
    setTimeout(() => {
      this.setState({
        parentData: {
          msg: 'hello Xiaoming',
          time: '2021-01-01 00:00:000'
        }
      });
    }, 5000);
  }

  render() {
    return (<div>
      <HelloWorld data={this.state.parentData} />
    </div>);
  }

}
